﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;

namespace VisualGTest
{
    class StatusCell : DataGridViewImageCell
    {
        protected override Object GetFormattedValue(
            Object value,
            int rowIndex,
            ref DataGridViewCellStyle cellStyle,
            TypeConverter valueTypeConverter,
            TypeConverter formattedValueTypeConverter,
            DataGridViewDataErrorContexts context)
        {
            TestResult.TestStatus status = (TestResult.TestStatus) value;

            switch (status)
            {
                case TestResult.TestStatus.Failure:
                    return VisualGTest.UI.Resources.CriticalError;
    
                case TestResult.TestStatus.Pending:
                    return VisualGTest.UI.Resources.pending_request;

                case TestResult.TestStatus.Started:
                    return VisualGTest.UI.Resources.Arrow;

                case TestResult.TestStatus.Success:
                    return VisualGTest.UI.Resources.Complete_OK;
            }

            return null;
        }
    }
}
